package com.lzc.springboot;

import com.lzc.springboot.domain.Question;
import com.lzc.springboot.mapper.QuestionMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.sql.Timestamp;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = SpringbootApplication.class)
public class test {

  @Autowired
  private QuestionMapper questionMapper;

  @Test
  public void testAdd(){
    long currentTimeMillis = System.currentTimeMillis();
    Timestamp timestamp = new Timestamp(currentTimeMillis);
    Question question = new Question();
    question.setDate(timestamp.toString());
    question.setEid(1);
    question.setFid(2);
    questionMapper.addQuestion(question);
  }
}
